//
//  BQCheckin_RuleViewController.m
//  Adorable_Things
//
//  Created by ybq on 16/1/15.
//  Copyright © 2016年 Banana Inc. All rights reserved.
//

#import "BQCheckin_RuleViewController.h"
#import "BQNavViewCommon.h"

@interface BQCheckin_RuleViewController ()

@property (nonatomic, strong) UIWebView *webView;
@property (nonatomic, strong) BQNavViewCommon *navView;

@end

@implementation BQCheckin_RuleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    // Do any additional setup after loading the view.
    [self createUI];
}

- (void)createUI {
    _navView = [[BQNavViewCommon alloc] initWithFrame:CGRectMake(0, 20, kWidth, 44)];
    [_navView.backButton addTarget:self action:@selector(backButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
    _navView.titleLabel.text = @"签到规则";
    [self.view addSubview:_navView];
    
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64, kWidth, kHeight - 64)];
    _webView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_webView];
    NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://m.menghuoapp.com/checkin_rule.html"]];
    NSString *string = [[NSString alloc] initWithData:data encoding:(NSUTF8StringEncoding)];
    [_webView loadHTMLString:string baseURL:nil];
}

- (void)backButtonAction:(UIButton *)button {
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
